﻿@model List<GTAuto.DAL.Entities.GTAdCategory>
@{
    ViewBag.Title = "Categories";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h4 class="alert_info">
     Категории объявлении</h4>
<!-- end of stats article -->
@using (Html.BeginForm("CategoryEdit", "Ads", FormMethod.Get, new { @class = "jNice" }))
{
    <article class="module width_full">
		
			<footer>
				<div class="submit_link">
					<input type="submit" value="Добавить категорию" class="alt_btn">
					
				</div>
			</footer>
		</article>
}


<div class="clear">
</div>
<article class="module width_full">
    <header><h3 class="tabs_involved">Категории</h3>
    
    </header>

    <div class="tab_container">
        <div id="tab1" class="tab_content">
            <table class="tablesorter" cellspacing="0"> 
                <thead> 
                    <tr> 
                       
                        <th style="text-align: left">Название</th> 

                        <th style="text-align: left">Родителская категория</th> 
<th></th> 
                        <th></th> 
                    </tr> 
                </thead> 
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr> 
                            <td>@item.Name</td> 
                            
                            @if (item.ParentId != null)
                            {

                                <td>@item.AdCategory1.Name</td>
                            }
                            else
                            {
                                <td></td>
                            }
                            <td><a href=@Url.Content("~/Ads/CategoryEdit/" + item.Id) class="edit">Ред.</a></td> 
                            <td><a href=@Url.Content("~/Dictionary/BrandDelete/" + item.Id) class="delete" onclick="if (!confirm('Вы уверены ?')) return  false;" >Удалить</a></td> 
                        </tr>
                    }
			
                </tbody> 
            </table>
        </div><!-- end of #tab1 -->
			
    </div><!-- end of .tab_container -->
		
</article>
<div class="clear">
</div>